package com.miaostars.level.data;

public class PlayerStats {
    private int kills;
    private int deaths;
    private double cps;

    // 序列化用于Redis同步
    public String serialize() {
        return kills + ":" + deaths + ":" + cps;
    }
    
    public static PlayerStats deserialize(String data) {
        String[] parts = data.split(":");
        PlayerStats stats = new PlayerStats();
        stats.kills = Integer.parseInt(parts[0]);
        stats.deaths = Integer.parseInt(parts[1]);
        stats.cps = Double.parseDouble(parts[2]);
        return stats;
    }
}